import 'package:flutter_k9/esc_command.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_k9/flutter_k9.dart';
import 'package:flutter_k9/flutter_k9_platform_interface.dart';
import 'package:flutter_k9/flutter_k9_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterK9Platform
    with MockPlatformInterfaceMixin
    implements FlutterK9Platform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<bool> print(List<EscCommand> commands) {
    // TODO: implement print
    throw UnimplementedError();
  }

  @override
  Future<bool?> connect() {
    // TODO: implement connect
    throw UnimplementedError();
  }
}

void main() {
  final FlutterK9Platform initialPlatform = FlutterK9Platform.instance;

  test('$MethodChannelFlutterK9 is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterK9>());
  });

  test('getPlatformVersion', () async {
    FlutterK9 flutterK9Plugin = FlutterK9();
    MockFlutterK9Platform fakePlatform = MockFlutterK9Platform();
    FlutterK9Platform.instance = fakePlatform;

    expect(await flutterK9Plugin.getPlatformVersion(), '42');
  });
}
